<?php
/**
 * +----------------------------------------------------------------------
 * | 会员管理模型
 */
namespace app\model;

// 引入框架内置类
use think\model;

class Movie extends Model
{
    // 定义时间戳字段名
    protected $createTime = 'create_time';
    protected $updateTime = 'update_time';
    protected $table = 'movie';

    public static function getList($whereIn){
        $res = self::whereIn('id',$whereIn)->select();
        return $res;
    }

    public static function getListSortGrade($offset = 0,$limit = 5){
        $res = self::where('grade','>',0)->order('grade','desc')->limit($offset,$limit)->select();
        return $res;
    }

    public static function movieSearch($title){
        $res = self::whereLike('title','%'.$title.'%')->select();
        return $res;
    }

    public static function getListById($id){
        $res = self::where('id',$id)->find();
        return $res;
    }

}
